package cn.ricecode.restructure.foundation.io;

import java.io.File;
import java.io.IOException;

/**
 * @author LiuZhulan
 */
public class FileTest {

    public static void main(String[] args) {
        File file=new File("D:\\java");
        if(!file.exists()){
            file.mkdir();
        }
        System.out.println(file.isDirectory());
        System.out.println(file.isFile());

        File file1=new File("D:\\java\\1.txt");
        if(!file.exists()){
            try {
                file1.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        System.out.println(file1.getAbsoluteFile());
        System.out.println(file1.getParentFile().getAbsoluteFile());
    }
}
